import { NestFactory } from '@nestjs/core'
import { AppModule } from './app.module'
import session from 'express-session'
import { loggerFunction } from './logger-function.middleware'
import { CustomExceptionFilter } from './custom-exception.filter'
async function bootstrap() {
  const app = await NestFactory.create(AppModule)
  // app.useGlobalFilters(new CustomExceptionFilter())
  app.use(session({
    secret: 'your-name',
    resave: false,
    saveUninitialized: false,
    cookie: {maxAge: 1000*60*60*24}
  }))
  // app.use(loggerFunction)
  await app.listen(3000)
}
bootstrap()
